﻿<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016-11-14
 * Time: 购物车
 */

defined('ByShopWWI') or exit('Access Invalid!');
class tempControl extends MobileControl{
	
    //商品订单
    public function indexOp(){
        Tpl::showpage('goods_order');
    }
    //购物车
    public function cartOp(){
        Tpl::showpage('goods_cart');
    }
    //购物车修改
    public function cartupdateOp(){
        Tpl::showpage('goods_cart-update');
    }
    //支付
    public function paymentOp(){
        Tpl::showpage('payment');
    }
    //登录
    public function loginOp(){
        Tpl::showpage('login');
    }
    //用户服务协议xieyi_detail.php
        public function xieyiOp(){
        Tpl::showpage('xieyi_detail');
    }
    //注册
    public function registerOp(){

        $_rg = $_GET['rg'];
        Tpl::output('rg',$_rg);
        Tpl::showpage('register');
    }  
    //空购物车
    public function cart2Op(){
        Tpl::showpage('cart_empty');
    }    
    //会员
    public function memberOp(){
        Tpl::showpage('member');
    }
    //找回密码
    public function findpasswordOp(){
        Tpl::showpage('findpassword');
    } 
    //重置密码
        public function resetpasswordOp(){
        Tpl::showpage('resetpassword');
    }
    //设置
    public function setOp(){
    Tpl::showpage('set');
    }
    //个人信息
    public function profileOp(){
    Tpl::showpage('profile');
    }
     
    //支付成功
    public function order_pay_successOp(){
    Tpl::showpage('order_pay_success');
    }  
    //支付失败
    public function order_pay_failOp(){
    Tpl::showpage('order_pay_fail');
    }      
    //地址设置
    public function addressOp(){
    Tpl::showpage('address');
    }  
    //添加地址
        public function addaddressOp(){
    Tpl::showpage('addaddress');
    }
    //地址列表
        public function addresslistOp(){
    Tpl::showpage('addresslist');
    }
    //性别设置
    public function setsexOp(){
    Tpl::showpage('setsex');
    }  
    //账户安全
    public function accountsafeOp(){
    Tpl::showpage('accountsafe');
    }  
    
    //修改密码
    public function updatepasswordOp(){
    Tpl::showpage('updatepassword');
    } 
    //设置支付密码
    public function paymentpasswordOp(){
    Tpl::showpage('paymentpassword');
    } 
    //绑定邮箱
    public function bindmailboxOp(){
    Tpl::showpage('bindmailbox');
    }
    //绑定手机号
    public function bindphoneOp(){
    Tpl::showpage('bindphone');
    }
    //实名认证
    public function realname_attestationOp(){
    Tpl::showpage('realname_attestation');
    } 
    //签到
    public function signOp(){
    Tpl::showpage('sign');
    }
    //订单状态
    public function orderstateOp(){
    Tpl::showpage('orderstate');
    } 
	//常见问题列表
	public function issueOp(){
        $type = $_GET['type'];

        $model_article = Model('cms_article');
        $condition = array();
        $condition['article_class_id'] = 3;
        $article_list = $model_article->getList($condition);

        Tpl::output('article_list',$article_list);
        Tpl::showpage('issue_list');
    }
    //常见问题详情
    public function issue_detailOp(){
        Tpl::showpage('issue_detail');
    }
    //订单详情
    public function orderdetailOp(){
    Tpl::showpage('order_detail');
    }
    //积分记录
    public function integral_recordOp(){
        Tpl::showpage('integral_record');
    }
    //积分规则
    public function integral_ruleOp(){
        Tpl::showpage('integral_rule');
    }
    //我的积分
    public function my_integralOp(){
        Tpl::showpage('my_integral');
    }
    //退款
    public function refundOp(){
        Tpl::showpage('refund');
    }

	public function msg_centerOp(){//消息中心
        Tpl::showpage('msg_center');
    }
    public function msg_detailOp(){//消息详情
        Tpl::showpage('msg_detail');
    }
    //退款
    public function refund_detailOp(){
        Tpl::showpage('refund_detail');
    }
     //退款物流
    public function refund_logisticsOp(){
        Tpl::showpage('refund_logistics');
    }
    //物流详情
    public function logistics_detailOp(){
        Tpl::showpage('logistics_detail');
    }
    //商品评论
    public function goods_commentOp(){
        Tpl::showpage('goods_comment');

    }
    //我的钱包
    public function moneybagOp(){
        Tpl::showpage('moneybag');
    }
    public function feedbackOp(){//意见反馈
        Tpl::showpage('feedback');
    }
    public function coupons_listOp(){//优惠券
        Tpl::showpage('coupons_list');
    }
    public function coupons_ruleOp(){//优惠券规则
        Tpl::showpage('coupons_rule');
    }

    public function sign_recordOp(){//签到记录
        Tpl::showpage('sign_record');
    }
    public function sign_ruleOp(){//签到规则
        Tpl::showpage('sign_rule');
    }
 //充值
    public function rechargeOp(){
        Tpl::showpage('recharge');
    }
    //充值记录
    public function recharge_logOp(){
        Tpl::showpage('recharge_log');
    }
    //充值成功
    public function recharge_succeedOp(){
        Tpl::showpage('recharge_succeed');
    }
    //提现
     public function cash_outOp(){
        Tpl::showpage('cash_out');
    }
    //提现2下一步
     public function cash_out2Op(){
        Tpl::showpage('cash_out2');
    }
     //提现2记录
     public function cash_outlogOp(){
        Tpl::showpage('cash_outlog');
    }
    //交易记录
     public function trade_logOp(){
        Tpl::showpage('trade_log');
    }
    //交易记录详情
     public function trade_log_detailsOp(){
        Tpl::showpage('trade_log_details');
    }
    
    //搜索
    public function souOp(){
        Tpl::showpage('product_list2');
    }
    //微信
    public function weixOp(){
        Tpl::showpage('weixin');
    }
    //新分类
    public function index3Op(){
        Tpl::showpage('index3');
    }
    //安全保障
    public function baozhangOp(){
        Tpl::output('html_title','安全保障');
        Tpl::showpage('baozhang');
    }
    
        //邀请 hyy
     public function inviteOp(){

         $invite_model= Model('member');
         $get_code=array();
         $get_code['user']= $_SESSION['member_name'];

         if(!$invite_model->selectCode($get_code)){
             $set_code=array();
             $set_code['user']= $_SESSION['member_name'];
             $set_code['code']= $_SESSION['member_id'];
             $invite_model->inviteCode($set_code);
         }

         $invite=$invite_model->selectCode(array('guest'=>$_SESSION['member_id']));

         $mb_invite= 'invite_'.$_SESSION['member_id']. '.png';
         $this->mb_invite($mb_invite);
         $invite_img= BASE_SITE_URL.DS.DIR_UPLOAD.DS.ATTACH_COMMON.DS.$mb_invite;
         Tpl::output('invite',$invite);
         Tpl::output('invite_img',$invite_img);

        Tpl::showpage('invite');
    }
        //邀请记录
     public function invite_logOp(){
         //$this->checkLogin();

         $invite_model= Model('member');
         $get_code=array();
         $get_code['user']= $_SESSION['member_name'];

         if(!$invite_model->selectCode($get_code)){
             $set_code=array();
             $set_code['user']= $_SESSION['member_name'];
             $set_code['code']= $_SESSION['member_id'];
             $invite_model->inviteCode($set_code);
         }

         $invite=$invite_model->selectCode(array('guest'=>$_SESSION['member_id']));
         Tpl::output('invite',$invite);
         Tpl::showpage('invite_log');
    }


    /**
     * 生成二维码
     */
    public function mb_invite($invite) {
        $url = APP_SITE_URL.DS.'index.php?act=temp&op=register&rg='.$_SESSION['member_id'];
        require_once(BASE_RESOURCE_PATH.DS.'phpqrcode'.DS.'index.php');
        $PhpQRCode = new PhpQRCode();
        $PhpQRCode->set('pngTempDir',BASE_UPLOAD_PATH.DS.ATTACH_COMMON.DS);
        $PhpQRCode->set('date',$url);
        $PhpQRCode->set('pngTempName', $invite);
        $PhpQRCode->init();

    }

}